package com.hanrui.android.activity.work;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.hanrui.android.R;
import com.hanrui.android.library.base.ActionBarBaseActivity;
import com.hanrui.android.model.ArchivesCheckDetailBean;
import com.hanrui.android.net.contract.work.archives.ArchivesCheckDetailContract;
import com.hanrui.android.net.presenter.work.archives.ArchivesCheckDetailPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ArchivesCheckDetailActivity extends ActionBarBaseActivity<ArchivesCheckDetailPresenter> implements ArchivesCheckDetailContract.View {

    String id;

    @BindView(R.id.main_title)
    TextView mainTitle;
    @BindView(R.id.subhead_title)
    TextView subheadTitle;
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.thing_title)
    TextView thing_title;
    @BindView(R.id.time)
    TextView time;
    @BindView(R.id.money_meet)
    TextView money_meet;
    @BindView(R.id.leaders)
    TextView leaders;
    @BindView(R.id.assign_body)
    TextView assign_body;


    @Override
    protected void initInjector() {mActivityComponent.inject(this);}


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_archivescheckdetail);

        unbinder = ButterKnife.bind(this);

        mTitleBar.setTitle("员工信息");

        id = getIntent().getStringExtra("id");

        mPresenter.employeeDetail(this,id);


    }

    public static void start(Context context, String id){

        Intent intent = new Intent(context,ArchivesCheckDetailActivity.class);
        intent.putExtra("id",id);
        context.startActivity(intent);

    }

    @Override
    public void employeeDetail(final ArchivesCheckDetailBean data) {

        if (null != data) {

            mainTitle.setText(data.getEmployee().getName());
            subheadTitle.setText("电话："+data.getEmployee().getMobilePhone());
            name.setText(data.getEmployee().getWorkDate());
            thing_title.setText(data.getEmployee().getPoliticalStatus());
            time.setText(data.getEmployee().getEducation());
            money_meet.setText(data.getEmployee().getMajor());
            leaders.setText(data.getEmployee().getEntryDate());
            assign_body.setText(data.getEmployee().getUserTypeName());
        }

    }
}
